﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

namespace ExceptionMessageBoxLibrary
{
    /// <summary>
    /// View Model for <see cref="IExceptionMessageBoxView"/>.
    /// </summary>
    public class ExceptionMessageBoxViewModel
    {
        //TODO: property change notification for exception messagebox has yet implemented. to be implement when it's needed.

        public ExceptionMessageBoxViewModel()
        {
            Caption = "Exception Message";
            UserMessage = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.";
            MessageBoxButton = MessageBoxButton.OK;
        }

        public String Caption { get; set; }

        /// <summary>
        /// User Message
        /// </summary>
        public String UserMessage { get; set; }

        public String ExceptionDetail { get; set; }

        public MessageBoxButton MessageBoxButton { get; set; }

        public Visibility OKVisibility
        {
            get
            {
                if (MessageBoxButton == MessageBoxButton.OK || MessageBoxButton == MessageBoxButton.OKCancel)
                    return Visibility.Visible;
                else
                    return Visibility.Collapsed;
            }
        }

        public Visibility CancelVisibility
        {
            get
            {
                if (MessageBoxButton == MessageBoxButton.OKCancel || MessageBoxButton == MessageBoxButton.YesNoCancel)
                    return Visibility.Visible;
                else
                    return Visibility.Collapsed;
            }
        }

        public Visibility YesVisibility
        {
            get
            {
                if (MessageBoxButton == MessageBoxButton.YesNo || MessageBoxButton == MessageBoxButton.YesNoCancel)
                    return Visibility.Visible;
                else
                    return Visibility.Collapsed;
            }
        }

        public Visibility NoVisibility
        {
            get
            {
                if (MessageBoxButton == MessageBoxButton.YesNo || MessageBoxButton == MessageBoxButton.YesNoCancel)
                    return Visibility.Visible;
                else
                    return Visibility.Collapsed;
            }
        }
    }
}
